#pragma once

#include "GLCell.h"
#include "OpenGL.h"

//struct floatColor;

namespace IDS {
	namespace OpenGL {

		//-----------------------------------------------------------------------------------------------
		/// This class manages the visualization of a portion of a 2D mesh
		/// using OpenGL display lists
		class GLCaching : public GLCellCaching
		{
		public:
			GLCaching();
			~GLCaching();
			void draw(GLCell* cell, int level);
			void refresh(bool onlyColours);

			enum Level { Faces, HighlightFaces, Edges, SelectEdges, SelectVerts, SelectFaces, NumLevels };

		private:
			void basicDraw(GLCell* cell, int level);
			//floatColor getElemColor(GLElement *elem, IDSVisManager& visMan);
			//void getElemFaceColors(GLElement *elem/, IDSVisManager& visMan, floatColor colors[2]);

			/// ID of the first display list
			GLuint list;

			/// Bit flags for the completed display lists
			unsigned compLev;

			/// Debug
			//IDSColor cellColor;
		};
	}
}
